package com.ssm.juc.time;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class TimeTest {

    public static void main(String[] args) {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        Calendar calendar = Calendar.getInstance();
        int now = calendar.get(Calendar.MINUTE);
        calendar.set(Calendar.MINUTE, now - 30);
        System.out.println(df.format(calendar.getTime()));
        ;
    }
}
